package edu.sctu.practice.class02.yangyuran.assign03.assign3_01;

/**
 * Created by Administrator on 2015/10/22.
 */
public class Test {
    static boolean equalArea(GeometricObject object1, GeometricObject object2) {
        return object1.findArea() == object2.findArea();
    }

    static void displayGeometricObject(GeometricObject object) {
        System.out.println();
        System.out.println(object.toString());
        System.out.println("图形颜色为：" + object.getColor());
        System.out.println("图形面积为：" + object.findArea());
        System.out.println("图形周长为：" + object.findPerimeter());
    }

    public static void main(String[] args) {
        GeometricObject circle = new Circle("蓝色", 2.0);
        GeometricObject rectangle = new Rectangle("白色", 3.0, 4.0);

        displayGeometricObject(circle);
        displayGeometricObject(rectangle);
        System.out.println();
        System.out.println("比较图形面积是否相同的结果为：" + equalArea(circle, rectangle));
    }
}

